package com.payment.system.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.payment.common.support.Convert;
import com.payment.system.domain.AdministrativeDivision;
import com.payment.system.mapper.AdministrativeDivisionMapper;
import com.payment.system.service.IAdministrativeDivisionService;

/**
 * 地区 服务层实现
 * 
 * @author payment
 * @date 2018-12-26
 */
@Service
public class AdministrativeDivisionServiceImpl implements IAdministrativeDivisionService 
{
	@Autowired
	private AdministrativeDivisionMapper administrativeDivisionMapper;

	/**
     * 查询地区信息
     * 
     * @param id 地区ID
     * @return 地区信息
     */
    @Override
	public AdministrativeDivision selectAdministrativeDivisionById(String id)
	{
	    return administrativeDivisionMapper.selectAdministrativeDivisionById(id);
	}
	
	/**
     * 查询地区列表
     * 
     * @param administrativeDivision 地区信息
     * @return 地区集合
     */
	@Override
	public List<AdministrativeDivision> selectAdministrativeDivisionList(AdministrativeDivision administrativeDivision)
	{
	    return administrativeDivisionMapper.selectAdministrativeDivisionList(administrativeDivision);
	}
	
    /**
     * 新增地区
     * 
     * @param administrativeDivision 地区信息
     * @return 结果
     */
	@Override
	public int insertAdministrativeDivision(AdministrativeDivision administrativeDivision)
	{
	    return administrativeDivisionMapper.insertAdministrativeDivision(administrativeDivision);
	}
	
	/**
     * 修改地区
     * 
     * @param administrativeDivision 地区信息
     * @return 结果
     */
	@Override
	public int updateAdministrativeDivision(AdministrativeDivision administrativeDivision)
	{
	    return administrativeDivisionMapper.updateAdministrativeDivision(administrativeDivision);
	}

	/**
     * 删除地区对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteAdministrativeDivisionByIds(String ids)
	{
		return administrativeDivisionMapper.deleteAdministrativeDivisionByIds(Convert.toStrArray(ids));
	}



	@Override
	public List<AdministrativeDivision> getRegionByParentId(String parentId) {
		return administrativeDivisionMapper.getRegionByParentId(parentId);
	}

}
